{%extends "index.html"%}
{%load i18n%}{%load ls%}
{%block title%}{% if query %}{{query}}{%else%}{%trans "nothing found"%}{% endif %}{%endblock%}
{%block body%}<body id="results">{%endblock%}
{%block content%}{%load comments%}{%load logic%}

{%if not result.object_list%}
<p>{%trans "Nothing found"%}</p>
{%else%}
{%trans "Search results for"%} '{{phrase}}'.
{%for post in result.object_list reversed%}
<div class="article">
<h1><a title="{{post.title}} torrent" href="/~{{post.author.username}}/{{post.slug}}/">{{post.title}}</a></h1>
<p class="meta"> <a title="{{post.author.name}}@{{site_domain}}" href="/~{{post.author.username}}/">{{post.author.name}}</a>, {{post.created|date:"jS F Y H:i"}}, {{post.torrent.bytes|measure}}</p>

<div class="body">
<p class="imageleft"><img title="{{post.title}}" src="/media/iposter/{{post.poster}}"></p>
<p>{{post.text|cut:"42"}}&nbsp;{%if post.text|words|gt:"42"%}<a title="{{post.title}}" href="/~{{post.author.username}}/{{post.slug}}/">&mdash;&gt;</a>{%endif%}</p>
</div>
<div class="footer"><h4 class="meta">{%trans "section"%}: </h4><p>'<a title="{%trans post.section%}" href="/sections/{{post.section}}/">{%trans post.section%}</a>'</p>
<h4 class="meta">{%trans "tags"%}: </h4><p>{%for tag in post.tags|truncate:"3"%}<a title="{{post.title}} {{tag.name}}" href="/tag/{{tag.name}}/">{{tag.name}}</a>{%if not forloop.last%}, {%endif%}{%endfor%}{%if post.tags|length|gt:"3"%} ...{%endif%}</p>
{% get_comment_count for post as comment_count %}
{%if comment_count%}
<a title="{{post.title}}" href="/~{{post.author.username}}/{{post.slug}}/"><h4 class="meta">{%trans "Comments"%}: {{comment_count}}</a></h4>{%else%}<a title="{{post.title}}" href="/~{{post.author.username}}/{{post.slug}}/"><h4 class="meta">{%trans "Leave comment"%}</a></h4>{%endif%}
</div>

</div>
{%endfor%}
{% load paginator %}{% paginator %}
{%endif%}
{% endblock %}
</div>
</div>
{%block right%}{%endblock%}
